<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="com.mysql.jdbc.Driver" %>
<%@ page import="java.sql.PreparedStatement" %>
<%
   String username  = request.getParameter("name");
   String password = request.getParameter("password");

   new Driver();
   Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306","root","root");
   String sql = "insert into db_demo.user values (null,?,?)";
   PreparedStatement ps = con.prepareStatement(sql);
   ps.setString(1,username);
   ps.setString(2,password);
   ps.executeUpdate();
   con.close();
   ps.close();
   request.getRequestDispatcher("successfulSingin.html").forward(request,response);
   out.println("insert mysql successfully!");
%>
